package com.qf.service.impl;

import com.alibaba.druid.sql.PagerUtils;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qf.entity.SystemMnue;
import com.qf.enumutil.SizeEnum;
import com.qf.mapper.MenuMapper;
import com.qf.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * 2019/11/29
 * 郭程鹏
 * gcp1909
 * 面向代码面向君,不负时光不负卿
 */
@Service
public class MenuImpl implements MenuService {
    @Resource
    private MenuMapper menuMapper;
    @Override
    public PageInfo<SystemMnue> allMenu(Map map, Integer page) {
        PageHelper.startPage(page, SizeEnum.pageSize.getSize());
        List<SystemMnue> mnues = menuMapper.allMenu(map);
        PageInfo<SystemMnue> pageInfo = new PageInfo<>(mnues);
        return pageInfo;
    }
}
